import { Injectable } from '@nestjs/common'
import { PrismaService } from 'src/common/prisma/prisma.service'
import { InputContent } from './dto/create-search.dto'

@Injectable()
export class SearchService {
   constructor(private readonly prisma: PrismaService) {}
   async findAll(inputContent: InputContent) {
      return await this.prisma.articel.findMany({
         where: {
            title: {
               contains: inputContent.title
            }
         },
         include: { user: true }
      })
   }
}
